package com.kun.kunkunmall.member.config;

import com.kun.kunkunmall.member.interceptor.LoginUserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MemberWebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        LoginUserInterceptor loginUserInterceptor = new LoginUserInterceptor();
        registry.addInterceptor(loginUserInterceptor).addPathPatterns("/**")
                .excludePathPatterns("/member/member/oauth2/login")
                .excludePathPatterns("/member/member/register")
                .excludePathPatterns("/member/member/login");
    }
}
